package com.tkjt.pms.modules.indexManage.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tkjt.pms.common.entity.TkIndexInfo;
import com.tkjt.pms.common.utils.OrgGroupUtil;
import com.tkjt.pms.modules.common.mapper.TkIndexInfoMapper;
import com.tkjt.pms.modules.indexManage.mapper.IndexManageMapper;
import com.tkjt.pms.modules.indexManage.service.IndexManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Transactional
@Service
public class IndexManageServiceImpl extends ServiceImpl<IndexManageMapper, TkIndexInfo> implements IndexManageService {

    @Autowired
    private TkIndexInfoMapper tkIndexInfoMapper;
    @Override
    public List<TkIndexInfo> getTkIndexInfoList(HttpServletRequest request) {
        String indexGroup=request.getParameter("indexGroup");//指标归属(1:事业群;2:社区&医院)
        indexGroup = OrgGroupUtil.changeToCG(indexGroup);
        Map<String, Object> attrParam = new HashMap<>();
        attrParam.put("indexGroup",indexGroup);
        List<TkIndexInfo> list = tkIndexInfoMapper.selectByArrtsParam(attrParam);
        return list;
    }
}
